import React, { Component } from 'react'

import kerwinPropTypes from 'prop-types'
console.log(kerwinPropTypes)
export default class Navbar extends Component {
 
  // 类属性
  static propTypes = {
    title: kerwinPropTypes.string,
    leftShow: kerwinPropTypes.bool
  }

  static defaultProps = {
    leftShow: true
  }
 
  // 属性是父组件传递来的，this.props
  render() {
    console.log(this.props)
    let {title, leftShow} = this.props

    // 对属性做验证

    return (
      <div>
        { leftShow && <button>返回</button> }
        navbar-{title}
        <button>home</button>
      </div>
    )
  }
}
